Supporting pydantic custom root models as columns#168
Closed
5cat wants to merge 2 commits into
Closed
Conversation
|
Status on the merge of this? It's quite crucial. |
I figure a good strategy now is to just merge what you need in your own fork. I suppose tiangolo checks these when he has time, but there's a long list so I wouldn't wait with anything crucial. |
Member
Contributor
|
As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #7
the approach was to wrap the model around a custom type similar to the SQLAlchemy documentation example .
although i thought about using hypothesis but it will introduce another dependency so i just typed arbitrary values for the tests since i didnt care about the individual values but their types.
So now it is possible to use pydantic custom root type models as column types.
there are some types that do not work with sqlite so i made pytest skip them